import Cookies from 'js-cookie'

const TokenKey = 'token'
const refToken='refreshToken'
const reTime='time'
const UserKey = 'user'


export function getToken() {
  return Cookies.get(TokenKey)
}

export function getRefToken() {
  return Cookies.get(refToken)
}

export function getTime() {
  return Cookies.get(reTime)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
export function setRefreshToken(token) {
  return Cookies.set(refToken, token)
}
export function setTime(time) {
  return Cookies.set(reTime, time)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function removeRefToken() {
  return Cookies.remove(refToken)
}
export function removeTime() {
  return Cookies.remove(reTime)
}

export function getUser() {
  return localStorage.getItem(UserKey);
}

export function setUser(user) {
  return localStorage.setItem(UserKey,user);
}

export function removeUser() {
  return localStorage.removeItem(UserKey);
}
